Name :Absolute displacement command
Symbol :MC_MoveAbsolute
Illustrate:
It is used to achieve the absolute displacement function of the shaft, and the rising edge is effective.
This command can be invoked only after the axis is enabled using the MC_Power directive, and when the axis position is determined (after the call MC_Home or MC_SetPosition is completed).
On the rising edge of EXECUTE, the input ABSPOS, VEL, ACC, JERK values are locked, and the PLCOpen state machine of the axis switches to DiscreteMotion and starts the absolute displacement movement.
If the current position is less than the target position, the axis will move in the forward direction, and if it is greater than the target position, the axis will move in the opposite direction and eventually reach the position set by ABSPOS.
This command can be interrupted and terminated: Instructions that can keep the axis in the ContinuousMotion, DiscreteMotion, and Stopping states can interrupt this command (the PLCOpen state machine of the reference axis), and when interrupted, the CMDABORTED will be valid, and the remaining unfinished distance will be discarded.
When the axis runs against the software limit, the command will be interrupted (CMDABORTED is valid), and the axis will stop moving but will not enter the Errorstop state, which can be modified to be far away from the target position of the software limit and re-triggered.
Image:
Parameter:
| The name of the parameter | data type | IN/OUT | Parameter role | Illustrate | Default value |
|---|---|---|---|---|---|
| AXISNO | UDINT | IN | Pulse shaft number | 0-7 | not |
| EXECUTE | BOOL | IN | Function block triggering | Rising edge triggers command execution (axis position is determined: call MC_Home or MC_SetPostion complete) | FALSE |
| ABSPOS | REAL | IN | Target location | The distance of the target position from the zero point (positive/negative/0), in units: unit | not |
| VEL | REAL | IN | Target speed | Target speed(non-0 value, absolute value valid), ≤ maximum acceleration, unit: unit/s | not |
| ACC | REAL | IN | acceleration | acceleration(non-0 value, absolute value valid), ≤ maximum acceleration, unit:unit/s | not |
| JERK | REAL | IN | J&A | Acceleration (valid in absolute terms), ≤ acceleration (0-T type acceleration and deceleration, non-0-S type acceleration and deceleration), unit:unit/s^2 | not |
| DIR | USINT | IN | direction | Rotational motion is reserved, linear motion is invalid | not |
| DONE | BOOL | OUT | Completion flag | TRUE:The execution is completed and the target location is reached | FALSE |
| BUSY | BOOL | OUT | Busy sign | TRUE:is in motion | FALSE |
| CMDABORTED | BOOL | OUT | End execution flag | TRUE:If it is interrupted by other instructions, the execution of this instruction will be terminated | FALSE |
| ERROR | BOOL | OUT | Error flags | TRUE:There was an error with the function block call | FALSE |
| ERRORID | UINT | OUT | Error codes | 0:Normal, Other: Error code value | 0 |
Example:
LD:
ST:
Interpretation:
AXISNO is 0, which means that the operating pulse axis is 0; EXECUTE is executed by FALSE->TRUE, and the rising edge triggers the instruction to execute; ABSPOS is 50, which means that the distance of the target position from the zero point is 50unit; VEL is 20, which means that the target speed is 20unit/s; ACC is 100, which means acceleration and deceleration at 100 unit/s until the target speed of 20 unit/s is reached; If JERK is 0, it will perform T-shaped acceleration and deceleration motion, and if it is not 0, it will perform S-type acceleration and deceleration motion; DIR is 0, reserved for rotational motion, not valid for linear motion; If DoneOut is TRUE, the execution is completed and the absolute position is reached. If BusyOut is TRUE, it means that the absolute displacement is being performed, and the BusyOut is reset after completion. If CmdAbortOut is TRUE, the execution has been terminated due to interruption. If ErrorOut is TURE, it means that there is an error and the command cannot be executed. If ErrorIdOut is 0, the execution is normal, and if it is not 0, there is an error and cannot be executed.